package com.zmn.oms.dubbo.impl.highopinion;

import cn.hutool.core.bean.BeanUtil;
import com.zmn.common.dto2.ResponseDTO;
import com.zmn.oms.common.dio.highopinion.OmsMasterHighOpinionDIO;
import com.zmn.oms.common.dro.highopinion.OmsMasterHighOpinionDRO;
import com.zmn.oms.dubbo.interfaces.highopinion.OmsMasterHighOpinionListRemoteService;
import com.zmn.oms.dubbo.utils.DubboConsts;
import com.zmn.oms.model.entity.highopinion.OmsMasterHighOpinion;
import com.zmn.oms.model.entity.highopinion.OmsMasterHighOpinionQuery;
import com.zmn.oms.services.interfaces.highopinion.OmsMasterHighOpinionService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author yangshuangpiung
 * @since 2022-9-13 11:22:15
 * description 获取工程师好评
 */
@Slf4j
@DubboService(loadbalance = "roundrobin", timeout = 20000, retries = 0, version = DubboConsts.INTERFACE_VERSION, validation = "true")
public class OmsMasterHighOpinionListRemoteServiceImpl implements OmsMasterHighOpinionListRemoteService {

    @Autowired
    private OmsMasterHighOpinionService omsMasterHighOpinionService;

    @Override
    public ResponseDTO<OmsMasterHighOpinionDRO> getMasterHighOpinion(Integer masterId) {
        OmsMasterHighOpinion omsMasterHighOpinions = omsMasterHighOpinionService.findById(masterId);
        OmsMasterHighOpinionDRO dro = new OmsMasterHighOpinionDRO();
        BeanUtil.copyProperties(omsMasterHighOpinions, dro);
        return ResponseDTO.success(dro);
    }
}

